package com.jianan.mis.data.domain.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the employee table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="employee"
 */

public abstract class BaseEmployee  implements Serializable {

	public static String REF = "Employee";
	public static String PROP_ENTER_DATE = "EnterDate";
	public static String PROP_NAME = "Name";
	public static String PROP_PHONE = "Phone";
	public static String PROP_BIRTHDAY = "Birthday";
	public static String PROP_PASSWORD = "Password";
	public static String PROP_USERNAME = "Username";
	public static String PROP_YIBAO_NO = "YibaoNo";
	public static String PROP_ID = "Id";
	public static String PROP_LEAVE_DATE = "LeaveDate";
	public static String PROP_MAIL = "Mail";
	public static String PROP_SHEBAO_NO = "ShebaoNo";


	// constructors
	public BaseEmployee () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseEmployee (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseEmployee (
		java.lang.Integer id,
		java.lang.String name,
		java.util.Date birthday,
		java.lang.String phone,
		java.lang.String username,
		java.lang.String password) {

		this.setId(id);
		this.setName(name);
		this.setBirthday(birthday);
		this.setPhone(phone);
		this.setUsername(username);
		this.setPassword(password);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String name;
	private java.util.Date birthday;
	private java.lang.String phone;
	private java.lang.String shebaoNo;
	private java.lang.String yibaoNo;
	private java.lang.String username;
	private java.lang.String password;
	private java.util.Date enterDate;
	private java.util.Date leaveDate;
	private java.lang.String mail;

	// collections
	private java.util.Set<com.jianan.mis.data.domain.Interman> intermans;
	private java.util.Set<com.jianan.mis.data.domain.Group> groups;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: name
	 */
	public java.lang.String getName () {
		return name;
	}

	/**
	 * Set the value related to the column: name
	 * @param name the name value
	 */
	public void setName (java.lang.String name) {
		this.name = name;
	}



	/**
	 * Return the value associated with the column: birthday
	 */
	public java.util.Date getBirthday () {
		return birthday;
	}

	/**
	 * Set the value related to the column: birthday
	 * @param birthday the birthday value
	 */
	public void setBirthday (java.util.Date birthday) {
		this.birthday = birthday;
	}



	/**
	 * Return the value associated with the column: phone
	 */
	public java.lang.String getPhone () {
		return phone;
	}

	/**
	 * Set the value related to the column: phone
	 * @param phone the phone value
	 */
	public void setPhone (java.lang.String phone) {
		this.phone = phone;
	}



	/**
	 * Return the value associated with the column: shebao_no
	 */
	public java.lang.String getShebaoNo () {
		return shebaoNo;
	}

	/**
	 * Set the value related to the column: shebao_no
	 * @param shebaoNo the shebao_no value
	 */
	public void setShebaoNo (java.lang.String shebaoNo) {
		this.shebaoNo = shebaoNo;
	}



	/**
	 * Return the value associated with the column: yibao_no
	 */
	public java.lang.String getYibaoNo () {
		return yibaoNo;
	}

	/**
	 * Set the value related to the column: yibao_no
	 * @param yibaoNo the yibao_no value
	 */
	public void setYibaoNo (java.lang.String yibaoNo) {
		this.yibaoNo = yibaoNo;
	}



	/**
	 * Return the value associated with the column: username
	 */
	public java.lang.String getUsername () {
		return username;
	}

	/**
	 * Set the value related to the column: username
	 * @param username the username value
	 */
	public void setUsername (java.lang.String username) {
		this.username = username;
	}



	/**
	 * Return the value associated with the column: password
	 */
	public java.lang.String getPassword () {
		return password;
	}

	/**
	 * Set the value related to the column: password
	 * @param password the password value
	 */
	public void setPassword (java.lang.String password) {
		this.password = password;
	}



	/**
	 * Return the value associated with the column: enter_date
	 */
	public java.util.Date getEnterDate () {
		return enterDate;
	}

	/**
	 * Set the value related to the column: enter_date
	 * @param enterDate the enter_date value
	 */
	public void setEnterDate (java.util.Date enterDate) {
		this.enterDate = enterDate;
	}



	/**
	 * Return the value associated with the column: leave_date
	 */
	public java.util.Date getLeaveDate () {
		return leaveDate;
	}

	/**
	 * Set the value related to the column: leave_date
	 * @param leaveDate the leave_date value
	 */
	public void setLeaveDate (java.util.Date leaveDate) {
		this.leaveDate = leaveDate;
	}



	/**
	 * Return the value associated with the column: mail
	 */
	public java.lang.String getMail () {
		return mail;
	}

	/**
	 * Set the value related to the column: mail
	 * @param mail the mail value
	 */
	public void setMail (java.lang.String mail) {
		this.mail = mail;
	}



	/**
	 * Return the value associated with the column: Intermans
	 */
	public java.util.Set<com.jianan.mis.data.domain.Interman> getIntermans () {
		return intermans;
	}

	/**
	 * Set the value related to the column: Intermans
	 * @param intermans the Intermans value
	 */
	public void setIntermans (java.util.Set<com.jianan.mis.data.domain.Interman> intermans) {
		this.intermans = intermans;
	}

	public void addToIntermans (com.jianan.mis.data.domain.Interman interman) {
		if (null == getIntermans()) setIntermans(new java.util.TreeSet<com.jianan.mis.data.domain.Interman>());
		getIntermans().add(interman);
	}



	/**
	 * Return the value associated with the column: Groups
	 */
	public java.util.Set<com.jianan.mis.data.domain.Group> getGroups () {
		return groups;
	}

	/**
	 * Set the value related to the column: Groups
	 * @param groups the Groups value
	 */
	public void setGroups (java.util.Set<com.jianan.mis.data.domain.Group> groups) {
		this.groups = groups;
	}

	public void addToGroups (com.jianan.mis.data.domain.Group group) {
		if (null == getGroups()) setGroups(new java.util.TreeSet<com.jianan.mis.data.domain.Group>());
		getGroups().add(group);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.jianan.mis.data.domain.Employee)) return false;
		else {
			com.jianan.mis.data.domain.Employee employee = (com.jianan.mis.data.domain.Employee) obj;
			if (null == this.getId() || null == employee.getId()) return false;
			else return (this.getId().equals(employee.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}